import { Collapse } from 'antd';
import React from 'react';
import OutputType = Terminal.OutputType
import Components from '../../../components/Components';
const { Panel } = Collapse;

interface PropsType{
    output:OutputType,
    key:string|number
}
export default function ICollapse(props:PropsType) {
    return (
        <Collapse className="term-theme" defaultActiveKey={[ '1' ]} expandIconPosition='end' bordered={false}>
            {
                <Panel key={props.key} header={ props.output.type === 'component' ? '' : props.output.text} className='term-theme'>
                    <Components>{props.output.component} </Components>
                </Panel>
            }
        </Collapse> 
    );
}
